<template>
    <view class="d-flex items-center justify-around dir-ltr" style="border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 32rpx; background: rgba(0, 0, 0, 0.15)">
        <view style="padding: 10rpx 26rpx;" @click="back">
            <u-icon name="/static/images/filim/arrow-left.png" color="white" class="mx-xs" style="opacity: 0.8"  width="18rpx" height="34rpx"></u-icon>
        </view>
        <view style="margin: 0px 8rpx; border-left: 2px solid white; height: 16px"></view>
        <view style="padding: 10rpx 26rpx;" @click="goHome()">
            <u-icon name="/static/images/filim/home.png" size="38rpx" color="white" class="mx-xs" style="opacity: 0.8" ></u-icon>
        </view>
    </view>
</template>
<script>
export default {
    methods: {
        back() {
            let pages = getCurrentPages()
            if (pages.length > 1) {
                // 如果有上一页，就返回上一页
                uni.navigateBack({
                    delta: 1,
                })
            } else {
                //没有上一页，就返回首页
                uni.switchTab({
                    url: '/pages/index/index',
                })
            }
        },
        goHome() {
            uni.switchTab({
                url: '/pages/index/index',
            })
        },
    },
}
</script>
